hackerrank tree top view solution

visit shbcf.ru